#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>

#define _N 1000000007
#define MOD(n) ((n) %= _N)

int64_t array[100][100];

static inline void operate(int x, int y) {
    if (x == 0 && y == 0) {
        array[x][y] = 1;
    } else {
        array[x][y] = 0;
    }
    if (x != 0) {
        array[x][y] += array[x - 1][y];
        MOD(array[x][y]);
    }
    if (y != 0) {
        array[x][y] += array[x][y - 1];
        MOD(array[x][y]);
    }
    if (x != 0 && y != 0) {
        array[x][y] += array[x - 1][y - 1];
        MOD(array[x][y]);
    }
}

void spread() {
    for (int i = 0; i <= 100; i++) {
        for (int j = 0; j <= i; j++) {
            int x = i - j;
            int y = j;
            operate(x, y);
        }
    }
    for (int i = 0; i < 100; i++) {
        for (int j = 0; j < 100 - i; j++) {
            int x = 100 - j;
            int y = i + j + 1;
            operate(x, y);
        }
    }
}

int main(void) {
    spread();
    int t;
    scanf("%d", &t);
    for (int i = 0; i < t; i++) {
        int n, m;
        scanf("%d%d", &n, &m);
        printf("%" PRId64 "\n", array[m][n]);
    }
    return 0;
}
